/*
 * @Descripttion: 
 * @version: 
 * @Author: sueRimn
 * @Date: 2022-09-22 15:33:50
 * @LastEditors: sueRimn
 * @LastEditTime: 2022-09-22 15:38:32
 */
import router from "@/router";
import store from "@/store";
export function refreshCurrentPage() {
  refreshPage();
}
function refreshPage() {
  let path = router.currentRoute.fullPath;
  let view = store.state.tagsView.visitedViews.filter(item => {
    return item.fullPath == path;
  })[0];
  if (!view) {
    view = store.state.tagsView.visitedViews.filter(item => {
      return item.path == '/dashboard';
    })[0]
  }
  store.dispatch('tagsView/delCachedView', view).then(() => {
    const { fullPath } = view
    router.replace({
      path: fullPath.replace('/redirect', ''),
      query: {
        date: +new Date()
      }
    })
  })
}